package com.bt.dmdb.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "ODS_PROJECT_USERS")
@SuppressWarnings("serial")
public class ProjectUser implements java.io.Serializable {

    private long id;
    private User user;
    private Character leadPm;
    private Character delegate;

    public ProjectUser() {
    }

    public ProjectUser(long id) {
        this.id = id;
    }

    public ProjectUser(long id, User user, Character leadPm, Character delegate) {
        this.id = id;
        this.user = user;
        this.leadPm = leadPm;
        this.delegate = delegate;
    }

    @Id
    @Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
    public long getId() {
        return this.id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "USER_ID")
    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Column(name = "LEAD_PM", length = 1)
    public Character getLeadPm() {
        return this.leadPm;
    }

    public void setLeadPm(Character leadPm) {
        this.leadPm = leadPm;
    }

    @Column(name = "DELEGATE", length = 1)
    public Character getDelegate() {
        return this.delegate;
    }

    public void setDelegate(Character delegate) {
        this.delegate = delegate;
    }
}
